package com.example.dormitory.controller;


import com.example.dormitory.entity.User;
import com.example.dormitory.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class LoginController {

    @Autowired
    private UserService userService ;

    @PostMapping("/login")
    public void login(@RequestBody User user){
        userService.login(user.getUserName(), user.getPassworld());
    }
}
